package org.itboys.kitchen.entity.mysql.order;

import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mongodb.entity.BaseMySqlEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 作者：jiangxiong
 * 日期：2016年11月25日
 * 联系方式 ：empty90911@126.com
 * 描述：农厨_订单_商品_实体
 */
public class KitchenOrder extends BaseMySqlEntity{
     //基础信息
    private String orderNo;//订单编号
    private Integer type;//1，商城，2积分,3采购
    private BigDecimal totalAmount;//订单金额应付(钱或积分)
    private BigDecimal payAmount;//订单金额实付(钱或积分)
    //private BigDecimal retailAmount;//订单零售价格。
    private BigDecimal costAmount;//订单成本价格
    private Integer payType;//付款方式,1支付宝，2微信，
    private String payNo;//付款流水号
    private Integer orderStatus;//订单状态
    private String receiveName;//收货人
    private String receiveMobile;//收货电话
    private String receiveAddress;//收货地址
    private Long memberId;//购买人Id;
    private String memberName;//购买人昵称
 //其他属性
    private Integer sendType;//配送方式。1，门店配送，2，自提
    private BigDecimal sendAmount;//配送费

    private Long couponId;//优惠券ID
    private BigDecimal couponAmount;//优惠券优惠金额
    private BigDecimal balancePayAmount;//余额抵扣金额。统计使用
    private BigDecimal aliPayAmount;//支付宝支付金额。统计使用
    private BigDecimal wechatPayAmount;//微信支付金额。统计使用

    private String promotionMsg;//促销，优惠信息
    private String remark;//订单备注
    private Long shopId;//门店ID
    private String shopName;//门店名称
    private Long villageId;//小区ID
    private String villageName;//小区名称
    private Long handleId;//员工（经办人）ID（商城订单中配送操作时记录）
    private String handleName;//员工（经办人）名称（商城订单中配送操作时记录）
    //配送者信息
    private Long driverId;//配送司机（员工）名称
    private String driverName;//配送司机（员工）名称 。积分订单：快递公司
    private String driverMobile;//配送司机（员工）联系电话。积分订单：快递公司代码
    private String driverCarNo;//配送车牌。积分订单：快递编号
    private String driverImage;//配送车辆图片
    //采购订单属性
    private Integer isAccount;//是否核销。0否，1是
    private BigDecimal accountAmount;//实际核销金额
    private String accountRemark;//核销备注
    private Integer userType;//用户类型，采购订单生成时，记录门店还是大客户
    //时间信息
    private Date payTime;//付款时间
    private Date sendTime;//配送时间
    private Date receiveTime;//收货时间
    private Integer isPos;//导入Pos订单
    //2017年7月1日 订单商品
    private List<KitchenOrderProduct> products;
    public KitchenOrder() {

    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getPayNo() {
        return payNo;
    }

    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getReceiveName() {
        return receiveName;
    }

    public void setReceiveName(String receiveName) {
        this.receiveName = receiveName;
    }

    public String getReceiveMobile() {
        return receiveMobile;
    }

    public void setReceiveMobile(String receiveMobile) {
        this.receiveMobile = receiveMobile;
    }

    public String getReceiveAddress() {
        return receiveAddress;
    }

    public void setReceiveAddress(String receiveAddress) {
        this.receiveAddress = receiveAddress;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public BigDecimal getSendAmount() {
        return sendAmount;
    }

    public void setSendAmount(BigDecimal sendAmount) {
        this.sendAmount = sendAmount;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public BigDecimal getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(BigDecimal couponAmount) {
        this.couponAmount = couponAmount;
    }

    public BigDecimal getBalancePayAmount() {
        return balancePayAmount;
    }

    public void setBalancePayAmount(BigDecimal balancePayAmount) {
        this.balancePayAmount = balancePayAmount;
    }

    public BigDecimal getAliPayAmount() {
        return aliPayAmount;
    }

    public void setAliPayAmount(BigDecimal aliPayAmount) {
        this.aliPayAmount = aliPayAmount;
    }

    public BigDecimal getWechatPayAmount() {
        return wechatPayAmount;
    }

    public void setWechatPayAmount(BigDecimal wechatPayAmount) {
        this.wechatPayAmount = wechatPayAmount;
    }

    public BigDecimal getCostAmount() {
        return costAmount;
    }

    public void setCostAmount(BigDecimal costAmount) {
        this.costAmount = costAmount;
    }

    /*    public BigDecimal getRetailAmount() {
        return retailAmount;
    }

    public void setRetailAmount(BigDecimal retailAmount) {
        this.retailAmount = retailAmount;
    }*/

    public String getPromotionMsg() {
        return promotionMsg;
    }

    public void setPromotionMsg(String promotionMsg) {
        this.promotionMsg = promotionMsg;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Long getVillageId() {
        return villageId;
    }

    public void setVillageId(Long villageId) {
        this.villageId = villageId;
    }

    public String getVillageName() {
        return villageName;
    }

    public void setVillageName(String villageName) {
        this.villageName = villageName;
    }

    public Long getHandleId() {
        return handleId;
    }

    public void setHandleId(Long handleId) {
        this.handleId = handleId;
    }

    public String getHandleName() {
        return handleName;
    }

    public void setHandleName(String handleName) {
        this.handleName = handleName;
    }

    public Long getDriverId() {
        return driverId;
    }

    public void setDriverId(Long driverId) {
        this.driverId = driverId;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public String getDriverMobile() {
        return driverMobile;
    }

    public void setDriverMobile(String driverMobile) {
        this.driverMobile = driverMobile;
    }

    public String getDriverCarNo() {
        return driverCarNo;
    }

    public void setDriverCarNo(String driverCarNo) {
        this.driverCarNo = driverCarNo;
    }

    public String getDriverImage() {
        return driverImage;
    }

    public void setDriverImage(String driverImage) {
        this.driverImage = driverImage;
    }

    public Integer getIsAccount() {
        return isAccount;
    }

    public void setIsAccount(Integer isAccount) {
        this.isAccount = isAccount;
    }

    public BigDecimal getAccountAmount() {
        return accountAmount;
    }

    public void setAccountAmount(BigDecimal accountAmount) {
        this.accountAmount = accountAmount;
    }

    public String getAccountRemark() {
        return accountRemark;
    }

    public void setAccountRemark(String accountRemark) {
        this.accountRemark = accountRemark;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    /**
     * 状态的中文信息
     */
    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;

        switch (type) {
            case 1:
                typeStr="商城订单";
                break;
            case 2:
                typeStr="积分订单";
                break;
            case 3:
                typeStr="采购订单";
                break;
            default:
                break;
        }
        return typeStr;
    }

    public String  getOrderStatusStr(){
        String orderStatusStr= "";
        if(orderStatus==null)return orderStatusStr;

        switch (orderStatus) {
            case 1:
                orderStatusStr="待付款";
                break;
            case 2:
                orderStatusStr="待配送";
                break;
            case 3:
                if(type==1&&sendType==2){
                    orderStatusStr="配送中【自提】";
                }else{
                    orderStatusStr="配送中";
                }

                break;
            case 4:
                orderStatusStr="待评价";
                break;
            case 5:
                orderStatusStr="已评价";
                break;
            case 6:
                orderStatusStr="待退款";
                break;
            case 7:
                orderStatusStr="已退款";
                break;
            case 8:
                orderStatusStr="待退货";
                break;
            case 9:
                orderStatusStr="已退货";
                break;
            case 10:
                orderStatusStr="已取消";
                break;
            default:
                break;
        }
        return orderStatusStr;
    }
    public String  getSendTypeStr(){
        String sendTypeStr= "";
        if(sendType==null)return sendTypeStr;

        switch (sendType) {
            case 1:
                sendTypeStr="门店配送";
                break;
            case 2:
                sendTypeStr="自提";
                break;
            case 3:
                sendTypeStr="其他";
                break;
            default:
                break;
        }
        return sendTypeStr;
    }
    public String getPayTimeStr(){
        if(payTime!=null)return TimeUtils.formatToTime(payTime);
        return null;
    }
    public String getSendTimeStr(){
        if(sendTime!=null)return TimeUtils.formatToTime(sendTime);
        return null;
    }
    public String getReceiveTimeStr(){
        if(receiveTime!=null)return TimeUtils.formatToTime(receiveTime);
        return null;
    }
    public String  getUserTypeStr(){
        String userTypeStr= "";
        if(userType==null)return userTypeStr;
        if(type==3){
            switch (userType) {
                case 2:
                    userTypeStr="门店采购";
                    break;
                case 3:
                    userTypeStr="大客户采购";
                    break;

                default:
                    break;
            }
        }

        return userTypeStr;
    }

    public List<KitchenOrderProduct> getProducts() {
        return products;
    }

    public void setProducts(List<KitchenOrderProduct> products) {
        this.products = products;
    }

    public Integer getIsPos() {
        return isPos;
    }

    public void setIsPos(Integer isPos) {
        this.isPos = isPos;
    }
}


